(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 7.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[     40459,       1215]
NotebookOptionsPosition[     38473,       1146]
NotebookOutlinePosition[     38836,       1162]
CellTagsIndexPosition[     38793,       1159]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell["\<\
Example 1: Two-link pendulums with no control and LQR control.
MEEN 652, Fall 2012
Copyright \[Copyright] 2012 Ryan W. Sinnet. All rights reserved.\
\>", "Text",
 CellChangeTimes->{{3.5439215193029747`*^9, 3.5439215313746653`*^9}, {
  3.543926054111351*^9, 3.5439261990716424`*^9}, {3.543926447703863*^9, 
  3.5439264731443186`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"NotebookDirectory", "[", "]"}]], "Input",
 CellChangeTimes->{{3.5439215441983986`*^9, 3.543921546231515*^9}}],

Cell[BoxData[
 FormBox["\<\"D:\\\\Documents\\\\meen-652-biped\\\\code\\\\example1\\\\\"\>", 
  TraditionalForm]], "Output",
 CellChangeTimes->{3.543921546915554*^9, 3.543921739805587*^9, 
  3.5439232655128527`*^9, 3.5439233662946167`*^9, 3.543923433194443*^9}]
}, Open  ]],

Cell[BoxData[{
 RowBox[{"<<", "RobotLinks.m"}], "\[IndentingNewLine]", 
 RowBox[{"<<", "Linearize.m"}]}], "Input",
 CellChangeTimes->{{3.5439225418884635`*^9, 3.54392254532666*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"ParallelSimplify", "[", 
   RowBox[{"A_", "?", "MatrixQ"}], "]"}], ":=", 
  RowBox[{"ParallelTable", "[", 
   RowBox[{
    RowBox[{"Simplify", "[", 
     RowBox[{"A", "\[LeftDoubleBracket]", 
      RowBox[{"i", ",", "j"}], "\[RightDoubleBracket]"}], "]"}], ",", 
    RowBox[{"{", 
     RowBox[{"i", ",", 
      RowBox[{
       RowBox[{"Dimensions", "[", "A", "]"}], "\[LeftDoubleBracket]", "1", 
       "\[RightDoubleBracket]"}]}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"j", ",", 
      RowBox[{
       RowBox[{"Dimensions", "[", "A", "]"}], "\[LeftDoubleBracket]", "2", 
       "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], "\n", 
 RowBox[{
  RowBox[{"ParallelSimplify", "[", 
   RowBox[{"A_", "?", "VectorQ"}], "]"}], ":=", 
  RowBox[{"ParallelTable", "[", 
   RowBox[{
    RowBox[{"Simplify", "[", 
     RowBox[{"A", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}], 
     "]"}], ",", 
    RowBox[{"{", 
     RowBox[{"i", ",", 
      RowBox[{"Length", "[", "A", "]"}]}], "}"}]}], "]"}]}], "\n", 
 RowBox[{
  RowBox[{"ParallelSimplify", "[", "A_", "]"}], ":=", 
  RowBox[{"Simplify", "[", "A", "]"}]}]}], "Input",
 CellChangeTimes->{{3.525444031603923*^9, 3.525444057323394*^9}, 
   3.525444167371688*^9, {3.5254442077009945`*^9, 3.5254442142373686`*^9}, {
   3.5254442656763105`*^9, 3.52544431862834*^9}, {3.5254446389836626`*^9, 
   3.525444643198904*^9}, {3.5273464706540365`*^9, 3.527346473775215*^9}, 
   3.527423798626493*^9}],

Cell["\<\
Define the configuration of the system:\
\>", "Text",
 CellChangeTimes->{{3.5439263424228415`*^9, 3.543926347487131*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ndof", " ", "=", " ", "2"}], ";"}]], "Input",
 CellChangeTimes->{{3.5158694971113553`*^9, 3.51586950751295*^9}, {
  3.515885996605161*^9, 3.5158859966675615`*^9}, {3.543921561056363*^9, 
  3.5439215611763697`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"q", "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{
      SubscriptBox["\[Theta]", "1"], "[", "t", "]"}], ",", 
     RowBox[{
      SubscriptBox["\[Theta]", "2"], "[", "t", "]"}]}], "}"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"dq", "=", 
   RowBox[{
    SubscriptBox["\[PartialD]", "t"], "q"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"ddq", "=", 
   RowBox[{
    SubscriptBox["\[PartialD]", "t"], "dq"}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.543921783651095*^9, 3.5439217966638393`*^9}, {
  3.54392224442645*^9, 3.543922247104603*^9}, {3.5439223135854053`*^9, 
  3.543922318286674*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   SubscriptBox["\[Xi]", "q1"], "=", 
   RowBox[{"ParallelSimplify", "[", 
    RowBox[{"RevoluteTwist", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   SubscriptBox["\[Xi]", "q2"], "=", 
   RowBox[{"ParallelSimplify", "[", 
    RowBox[{"RevoluteTwist", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"0", ",", 
        RowBox[{"-", "1"}], ",", "0"}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "]"}], "]"}]}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.543921800739072*^9, 3.5439218575543213`*^9}, {
  3.5439244581870694`*^9, 3.54392446029819*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{
    SubscriptBox["g", 
     SubscriptBox["sl", "1"]], "[", "0", "]"}], "=", 
   RowBox[{"ParallelSimplify", "[", 
    RowBox[{"RPToHomogeneous", "[", 
     RowBox[{
      RowBox[{"IdentityMatrix", "[", "3", "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"0", ",", 
        RowBox[{
         RowBox[{"-", "1"}], "/", "2"}], ",", "0"}], "}"}]}], "]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    SubscriptBox["g", 
     SubscriptBox["sl", "2"]], "[", "0", "]"}], "=", 
   RowBox[{"ParallelSimplify", "[", 
    RowBox[{"RPToHomogeneous", "[", 
     RowBox[{
      RowBox[{"IdentityMatrix", "[", "3", "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"0", ",", 
        RowBox[{
         RowBox[{"-", "3"}], "/", "2"}], ",", "0"}], "}"}]}], "]"}], "]"}]}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.543921837508175*^9, 3.543921865722789*^9}, {
  3.5439219619402924`*^9, 3.543921970850802*^9}}],

Cell["\<\
Compute the forward kinematics of the masses\
\>", "Text",
 CellChangeTimes->{{3.5439263503912973`*^9, 3.543926356334637*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   SubscriptBox["g", "1"], "[", "\[Theta]", "]"}], "=", 
  RowBox[{"ParallelSimplify", "[", 
   RowBox[{"ForwardKinematics", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       SubscriptBox["\[Xi]", "q1"], ",", 
       RowBox[{
        SubscriptBox["\[Theta]", "1"], "[", "t", "]"}]}], "}"}], ",", 
     RowBox[{
      SubscriptBox["g", 
       SubscriptBox["sl", "1"]], "[", "0", "]"}]}], "]"}], 
   "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   SubscriptBox["g", "2"], "[", "\[Theta]", "]"}], "=", 
  RowBox[{"ParallelSimplify", "[", 
   RowBox[{"ForwardKinematics", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       SubscriptBox["\[Xi]", "q1"], ",", 
       RowBox[{
        SubscriptBox["\[Theta]", "1"], "[", "t", "]"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       SubscriptBox["\[Xi]", "q2"], ",", 
       RowBox[{
        SubscriptBox["\[Theta]", "2"], "[", "t", "]"}]}], "}"}], ",", 
     RowBox[{
      SubscriptBox["g", 
       SubscriptBox["sl", "2"]], "[", "0", "]"}]}], "]"}], "]"}]}]}], "Input",\

 CellChangeTimes->{{3.5439218850978975`*^9, 3.5439219408430853`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{"(", "\[NoBreak]", GridBox[{
     {
      RowBox[{"cos", "(", 
       RowBox[{
        SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}], 
      RowBox[{"-", 
       RowBox[{"sin", "(", 
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}]}], "0", 
      RowBox[{
       FractionBox["1", "2"], " ", 
       RowBox[{"sin", "(", 
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}]}]},
     {
      RowBox[{"sin", "(", 
       RowBox[{
        SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}], 
      RowBox[{"cos", "(", 
       RowBox[{
        SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}], "0", 
      RowBox[{
       RowBox[{"-", 
        FractionBox["1", "2"]}], " ", 
       RowBox[{"cos", "(", 
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}]}]},
     {"0", "0", "1", "0"},
     {"0", "0", "0", "1"}
    },
    GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
      "RowsIndexed" -> {}},
    GridBoxSpacings->{"Columns" -> {
        Offset[0.27999999999999997`], {
         Offset[0.7]}, 
        Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
        Offset[0.2], {
         Offset[0.4]}, 
        Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{{3.5439219393179984`*^9, 3.5439219410931*^9}, 
   3.543921971905862*^9, 3.5439222486036882`*^9, 3.54392232206389*^9, 
   3.543923268307012*^9, 3.5439233690097723`*^9, 3.5439234360216045`*^9, 
   3.5439244617392726`*^9}],

Cell[BoxData[
 FormBox[
  RowBox[{"(", "\[NoBreak]", GridBox[{
     {
      RowBox[{"cos", "(", 
       RowBox[{
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
        RowBox[{
         SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}], 
      RowBox[{"-", 
       RowBox[{"sin", "(", 
        RowBox[{
         RowBox[{
          SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
         RowBox[{
          SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}]}], "0", 
      RowBox[{
       RowBox[{"sin", "(", 
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}], "+", 
       RowBox[{
        FractionBox["1", "2"], " ", 
        RowBox[{"sin", "(", 
         RowBox[{
          RowBox[{
           SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}]}]}]},
     {
      RowBox[{"sin", "(", 
       RowBox[{
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
        RowBox[{
         SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}], 
      RowBox[{"cos", "(", 
       RowBox[{
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
        RowBox[{
         SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}], "0", 
      RowBox[{
       RowBox[{"-", 
        RowBox[{"cos", "(", 
         RowBox[{
          SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}]}], "-", 
       RowBox[{
        FractionBox["1", "2"], " ", 
        RowBox[{"cos", "(", 
         RowBox[{
          RowBox[{
           SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}]}]}]},
     {"0", "0", "1", "0"},
     {"0", "0", "0", "1"}
    },
    GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
      "RowsIndexed" -> {}},
    GridBoxSpacings->{"Columns" -> {
        Offset[0.27999999999999997`], {
         Offset[0.7]}, 
        Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
        Offset[0.2], {
         Offset[0.4]}, 
        Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{{3.5439219393179984`*^9, 3.5439219410931*^9}, 
   3.543921971905862*^9, 3.5439222486036882`*^9, 3.54392232206389*^9, 
   3.543923268307012*^9, 3.5439233690097723`*^9, 3.5439234360216045`*^9, 
   3.543924461765274*^9}]
}, Open  ]],

Cell["\<\
Compute the velocities of the masses:\
\>", "Text",
 CellChangeTimes->{{3.5439262927910028`*^9, 3.5439262987193418`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      SubscriptBox["v", "#"], "=", 
      RowBox[{"D", "[", 
       RowBox[{
        RowBox[{
         RowBox[{
          SubscriptBox["g", "#"], "[", "\[Theta]", "]"}], 
         "\[LeftDoubleBracket]", 
         RowBox[{
          RowBox[{"1", ";;", "3"}], ",", "4"}], "\[RightDoubleBracket]"}], 
        ",", 
        RowBox[{"{", "t", "}"}]}], "]"}]}], ")"}], "&"}], ")"}], "/@", 
  RowBox[{"Range", "[", "ndof", "]"}]}]], "Input",
 CellChangeTimes->{{3.5439219798843184`*^9, 3.5439220467601433`*^9}, {
  3.543922100337208*^9, 3.5439221018322935`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{"(", "\[NoBreak]", GridBox[{
     {
      RowBox[{
       FractionBox["1", "2"], " ", 
       RowBox[{"cos", "(", 
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}], " ", 
       RowBox[{
        SuperscriptBox[
         SubscriptBox["\[Theta]", "1"], "\[Prime]",
         MultilineFunction->None], "(", "t", ")"}]}], 
      RowBox[{
       FractionBox["1", "2"], " ", 
       RowBox[{"sin", "(", 
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}], " ", 
       RowBox[{
        SuperscriptBox[
         SubscriptBox["\[Theta]", "1"], "\[Prime]",
         MultilineFunction->None], "(", "t", ")"}]}], "0"},
     {
      RowBox[{
       RowBox[{
        RowBox[{"cos", "(", 
         RowBox[{
          SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}], " ", 
        RowBox[{
         SuperscriptBox[
          SubscriptBox["\[Theta]", "1"], "\[Prime]",
          MultilineFunction->None], "(", "t", ")"}]}], "+", 
       RowBox[{
        FractionBox["1", "2"], " ", 
        RowBox[{"cos", "(", 
         RowBox[{
          RowBox[{
           SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}], " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{
           SuperscriptBox[
            SubscriptBox["\[Theta]", "1"], "\[Prime]",
            MultilineFunction->None], "(", "t", ")"}], "+", 
          RowBox[{
           SuperscriptBox[
            SubscriptBox["\[Theta]", "2"], "\[Prime]",
            MultilineFunction->None], "(", "t", ")"}]}], ")"}]}]}], 
      RowBox[{
       RowBox[{
        RowBox[{"sin", "(", 
         RowBox[{
          SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}], " ", 
        RowBox[{
         SuperscriptBox[
          SubscriptBox["\[Theta]", "1"], "\[Prime]",
          MultilineFunction->None], "(", "t", ")"}]}], "+", 
       RowBox[{
        FractionBox["1", "2"], " ", 
        RowBox[{"sin", "(", 
         RowBox[{
          RowBox[{
           SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}], " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{
           SuperscriptBox[
            SubscriptBox["\[Theta]", "1"], "\[Prime]",
            MultilineFunction->None], "(", "t", ")"}], "+", 
          RowBox[{
           SuperscriptBox[
            SubscriptBox["\[Theta]", "2"], "\[Prime]",
            MultilineFunction->None], "(", "t", ")"}]}], ")"}]}]}], "0"}
    },
    GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
      "RowsIndexed" -> {}},
    GridBoxSpacings->{"Columns" -> {
        Offset[0.27999999999999997`], {
         Offset[0.7]}, 
        Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
        Offset[0.2], {
         Offset[0.4]}, 
        Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{3.543922047149166*^9, 3.543922105250489*^9, 
  3.5439222493557315`*^9, 3.5439223225389175`*^9, 3.543923268360015*^9, 
  3.5439233690577745`*^9, 3.543923436077608*^9, 3.5439244626923275`*^9}]
}, Open  ]],

Cell["Kinetic Energy:", "Text",
 CellChangeTimes->{{3.5439263012314854`*^9, 3.5439263031905975`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"T", "=", 
  RowBox[{"ParallelSimplify", "[", 
   RowBox[{
    UnderoverscriptBox["\[Sum]", "i", "ndof"], 
    FractionBox[
     RowBox[{
      SubscriptBox["v", "i"], ".", 
      SubscriptBox["v", "i"]}], "2"]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.5439220549756136`*^9, 3.543922121444415*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{
   FractionBox["1", "8"], " ", 
   RowBox[{"(", 
    RowBox[{
     SuperscriptBox[
      RowBox[{
       SuperscriptBox[
        SubscriptBox["\[Theta]", "2"], "\[Prime]",
        MultilineFunction->None], "(", "t", ")"}], "2"], "+", 
     RowBox[{
      SuperscriptBox[
       RowBox[{
        SuperscriptBox[
         SubscriptBox["\[Theta]", "1"], "\[Prime]",
         MultilineFunction->None], "(", "t", ")"}], "2"], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"4", " ", 
         RowBox[{"cos", "(", 
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "+", 
        "6"}], ")"}]}], "+", 
     RowBox[{"2", " ", 
      RowBox[{
       SuperscriptBox[
        SubscriptBox["\[Theta]", "2"], "\[Prime]",
        MultilineFunction->None], "(", "t", ")"}], " ", 
      RowBox[{
       SuperscriptBox[
        SubscriptBox["\[Theta]", "1"], "\[Prime]",
        MultilineFunction->None], "(", "t", ")"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"2", " ", 
         RowBox[{"cos", "(", 
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "+", 
        "1"}], ")"}]}]}], ")"}]}], TraditionalForm]], "Output",
 CellChangeTimes->{{3.5439220696734543`*^9, 3.543922122154456*^9}, 
   3.543922249735753*^9, 3.5439223229689417`*^9, 3.5439232683980174`*^9, 
   3.5439233690937767`*^9, 3.54392343611161*^9, 3.5439244636763835`*^9}]
}, Open  ]],

Cell["Potential Energy:", "Text",
 CellChangeTimes->{{3.543926304910696*^9, 3.543926307406839*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"V", "=", 
  RowBox[{
   RowBox[{
    RowBox[{"g", " ", 
     RowBox[{
      UnderoverscriptBox["\[Sum]", "i", "ndof"], 
      RowBox[{
       RowBox[{
        SubscriptBox["g", "i"], "[", "\[Theta]", "]"}], 
       "\[LeftDoubleBracket]", 
       RowBox[{"2", ",", "4"}], "\[RightDoubleBracket]"}]}]}], "/.", 
    "\[InvisibleSpace]", 
    RowBox[{"g", "\[Rule]", "10"}]}], "//", "ParallelSimplify"}]}]], "Input",
 CellChangeTimes->{{3.543922131384984*^9, 3.543922204555169*^9}, {
  3.543923354194925*^9, 3.5439233542819295`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"-", "5"}], " ", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"3", " ", 
      RowBox[{"cos", "(", 
       RowBox[{
        SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}]}], "+", 
     RowBox[{"cos", "(", 
      RowBox[{
       RowBox[{
        SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
       RowBox[{
        SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}]}], ")"}]}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{{3.5439221962446938`*^9, 3.543922204832185*^9}, 
   3.543922250097774*^9, 3.5439223232769594`*^9, 3.54392326844302*^9, {
   3.543923360713298*^9, 3.5439233691317787`*^9}, 3.5439234361516123`*^9, 
   3.5439244643894243`*^9}]
}, Open  ]],

Cell["Lagrangian:", "Text",
 CellChangeTimes->{{3.5439263104150105`*^9, 3.5439263118390923`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"\[GothicCapitalL]", "=", 
  RowBox[{"T", "-", "V"}]}]], "Input",
 CellChangeTimes->{{3.5439222130086527`*^9, 3.5439222209591074`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{
    FractionBox["1", "8"], " ", 
    RowBox[{"(", 
     RowBox[{
      SuperscriptBox[
       RowBox[{
        SuperscriptBox[
         SubscriptBox["\[Theta]", "2"], "\[Prime]",
         MultilineFunction->None], "(", "t", ")"}], "2"], "+", 
      RowBox[{
       SuperscriptBox[
        RowBox[{
         SuperscriptBox[
          SubscriptBox["\[Theta]", "1"], "\[Prime]",
          MultilineFunction->None], "(", "t", ")"}], "2"], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"4", " ", 
          RowBox[{"cos", "(", 
           RowBox[{
            SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "+", 
         "6"}], ")"}]}], "+", 
      RowBox[{"2", " ", 
       RowBox[{
        SuperscriptBox[
         SubscriptBox["\[Theta]", "2"], "\[Prime]",
         MultilineFunction->None], "(", "t", ")"}], " ", 
       RowBox[{
        SuperscriptBox[
         SubscriptBox["\[Theta]", "1"], "\[Prime]",
         MultilineFunction->None], "(", "t", ")"}], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", " ", 
          RowBox[{"cos", "(", 
           RowBox[{
            SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "+", 
         "1"}], ")"}]}]}], ")"}]}], "+", 
   RowBox[{"5", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"3", " ", 
       RowBox[{"cos", "(", 
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}]}], "+", 
      RowBox[{"cos", "(", 
       RowBox[{
        RowBox[{
         SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
        RowBox[{
         SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}]}], ")"}]}]}],
   TraditionalForm]], "Output",
 CellChangeTimes->{{3.5439222220621705`*^9, 3.5439222510978312`*^9}, 
   3.543922323873994*^9, 3.543923268478022*^9, {3.5439233618013597`*^9, 
   3.5439233691637807`*^9}, 3.5439234361856146`*^9, 3.54392446501946*^9}]
}, Open  ]],

Cell["\<\
Solve the Euler-Lagrange equation:\
\>", "Text",
 CellChangeTimes->{{3.543926314671254*^9, 3.5439263190385036`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"sol", "=", 
  RowBox[{"ParallelSimplify", "[", 
   RowBox[{"First", "[", 
    RowBox[{"Solve", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         SubscriptBox["\[PartialD]", "t"], 
         RowBox[{
          SubscriptBox["\[PartialD]", 
           RowBox[{"{", "dq", "}"}]], "\[GothicCapitalL]"}]}], "-", 
        RowBox[{
         SubscriptBox["\[PartialD]", 
          RowBox[{"{", "q", "}"}]], "\[GothicCapitalL]"}]}], "\[Equal]", 
       RowBox[{"ConstantArray", "[", 
        RowBox[{"0", ",", "ndof"}], "]"}]}], ",", "ddq"}], "]"}], "]"}], 
   "]"}]}]], "Input",
 CellChangeTimes->{{3.543922224014282*^9, 3.5439223102172127`*^9}, {
  3.54392236839454*^9, 3.543922369897626*^9}, {3.5439225028982334`*^9, 
  3.543922504321315*^9}, {3.5439229277865353`*^9, 3.5439229401632433`*^9}, {
  3.543924473201928*^9, 3.543924481085379*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{
    RowBox[{
     RowBox[{
      SuperscriptBox[
       SubscriptBox["\[Theta]", "1"], "\[Prime]\[Prime]",
       MultilineFunction->None], "(", "t", ")"}], "\[Rule]", 
     RowBox[{"-", 
      RowBox[{
       FractionBox["1", 
        RowBox[{
         RowBox[{"4", " ", 
          RowBox[{
           SuperscriptBox["cos", "2"], "(", 
           RowBox[{
            SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "-", 
         "5"}]], 
       RowBox[{"2", " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{
           SuperscriptBox[
            RowBox[{
             SuperscriptBox[
              SubscriptBox["\[Theta]", "1"], "\[Prime]",
              MultilineFunction->None], "(", "t", ")"}], "2"], " ", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"sin", "(", 
              RowBox[{
               SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}], "+", 
             RowBox[{"sin", "(", 
              RowBox[{"2", " ", 
               RowBox[{
                SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}]}], 
            ")"}]}], "+", 
          RowBox[{"2", " ", 
           RowBox[{
            SuperscriptBox[
             SubscriptBox["\[Theta]", "2"], "\[Prime]",
             MultilineFunction->None], "(", "t", ")"}], " ", 
           RowBox[{
            SuperscriptBox[
             SubscriptBox["\[Theta]", "1"], "\[Prime]",
             MultilineFunction->None], "(", "t", ")"}], " ", 
           RowBox[{"sin", "(", 
            RowBox[{
             SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "+", 
          RowBox[{
           SuperscriptBox[
            RowBox[{
             SuperscriptBox[
              SubscriptBox["\[Theta]", "2"], "\[Prime]",
              MultilineFunction->None], "(", "t", ")"}], "2"], " ", 
           RowBox[{"sin", "(", 
            RowBox[{
             SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "+", 
          RowBox[{"10", " ", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"sin", "(", 
              RowBox[{
               RowBox[{
                SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
               RowBox[{"2", " ", 
                RowBox[{
                 SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}]}], ")"}], 
             "-", 
             RowBox[{"2", " ", 
              RowBox[{"sin", "(", 
               RowBox[{
                SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}]}]}], 
            ")"}]}]}], ")"}]}]}]}]}], ",", 
    RowBox[{
     RowBox[{
      SuperscriptBox[
       SubscriptBox["\[Theta]", "2"], "\[Prime]\[Prime]",
       MultilineFunction->None], "(", "t", ")"}], "\[Rule]", 
     RowBox[{
      FractionBox["1", 
       RowBox[{
        RowBox[{"4", " ", 
         RowBox[{
          SuperscriptBox["cos", "2"], "(", 
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "-", 
        "5"}]], 
      RowBox[{"4", " ", 
       RowBox[{"cos", "(", 
        FractionBox[
         RowBox[{
          SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], "2"], ")"}], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", " ", 
          SuperscriptBox[
           RowBox[{
            SuperscriptBox[
             SubscriptBox["\[Theta]", "1"], "\[Prime]",
             MultilineFunction->None], "(", "t", ")"}], "2"], " ", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", " ", 
             RowBox[{"sin", "(", 
              FractionBox[
               RowBox[{
                SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], "2"], ")"}]}],
             "+", 
            RowBox[{"sin", "(", 
             FractionBox[
              RowBox[{"3", " ", 
               RowBox[{
                SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], "2"], 
             ")"}]}], ")"}]}], "+", 
         RowBox[{"2", " ", 
          RowBox[{
           SuperscriptBox[
            SubscriptBox["\[Theta]", "2"], "\[Prime]",
            MultilineFunction->None], "(", "t", ")"}], " ", 
          RowBox[{
           SuperscriptBox[
            SubscriptBox["\[Theta]", "1"], "\[Prime]",
            MultilineFunction->None], "(", "t", ")"}], " ", 
          RowBox[{"sin", "(", 
           FractionBox[
            RowBox[{"3", " ", 
             RowBox[{
              SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], "2"], ")"}]}],
          "+", 
         RowBox[{
          SuperscriptBox[
           RowBox[{
            SuperscriptBox[
             SubscriptBox["\[Theta]", "2"], "\[Prime]",
             MultilineFunction->None], "(", "t", ")"}], "2"], " ", 
          RowBox[{"sin", "(", 
           FractionBox[
            RowBox[{"3", " ", 
             RowBox[{
              SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], "2"], ")"}]}],
          "-", 
         RowBox[{"30", " ", 
          RowBox[{"sin", "(", 
           RowBox[{
            RowBox[{
             SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "-", 
            FractionBox[
             RowBox[{
              SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], "2"]}], ")"}]}],
          "+", 
         RowBox[{"20", " ", 
          RowBox[{"sin", "(", 
           RowBox[{
            RowBox[{
             SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
            RowBox[{
             SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}], " ", 
          RowBox[{"cos", "(", 
           FractionBox[
            RowBox[{
             SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], "2"], ")"}]}]}], 
        ")"}]}]}]}]}], "}"}], TraditionalForm]], "Output",
 CellChangeTimes->{{3.5439222736471205`*^9, 3.543922324425025*^9}, {
   3.5439223645553207`*^9, 3.543922370187643*^9}, 3.5439225046873355`*^9, {
   3.5439229291676145`*^9, 3.543922942287365*^9}, 3.543923268550026*^9, {
   3.543923362798417*^9, 3.5439233692297845`*^9}, 3.5439234362576184`*^9, {
   3.543924466347536*^9, 3.54392448250346*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"Transpose", "[", 
   RowBox[{"{", 
    RowBox[{"ddq", "/.", "\[InvisibleSpace]", "sol"}], "}"}], "]"}], "//", 
  "ParallelSimplify"}]], "Input",
 CellChangeTimes->{{3.5439229112715907`*^9, 3.5439229442964797`*^9}, {
   3.5439233983924527`*^9, 3.543923401864651*^9}, 3.543924489621867*^9, {
   3.5439246879292097`*^9, 3.543924754808035*^9}, {3.5439262386649065`*^9, 
   3.5439262768160887`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{"(", "\[NoBreak]", GridBox[{
     {
      RowBox[{"-", 
       FractionBox[
        RowBox[{"2", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{
            RowBox[{"(", 
             RowBox[{
              RowBox[{"sin", "(", 
               RowBox[{
                SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}], "+", 
              RowBox[{"sin", "(", 
               RowBox[{"2", " ", 
                RowBox[{
                 SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}]}], 
             ")"}], " ", 
            SuperscriptBox[
             RowBox[{
              SuperscriptBox[
               SubscriptBox["\[Theta]", "1"], "\[Prime]",
               MultilineFunction->None], "(", "t", ")"}], "2"]}], "+", 
           RowBox[{"2", " ", 
            RowBox[{"sin", "(", 
             RowBox[{
              SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}], " ", 
            RowBox[{
             SuperscriptBox[
              SubscriptBox["\[Theta]", "2"], "\[Prime]",
              MultilineFunction->None], "(", "t", ")"}], " ", 
            RowBox[{
             SuperscriptBox[
              SubscriptBox["\[Theta]", "1"], "\[Prime]",
              MultilineFunction->None], "(", "t", ")"}]}], "+", 
           RowBox[{
            RowBox[{"sin", "(", 
             RowBox[{
              SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}], " ", 
            SuperscriptBox[
             RowBox[{
              SuperscriptBox[
               SubscriptBox["\[Theta]", "2"], "\[Prime]",
               MultilineFunction->None], "(", "t", ")"}], "2"]}], "+", 
           RowBox[{"10", " ", 
            RowBox[{"(", 
             RowBox[{
              RowBox[{"sin", "(", 
               RowBox[{
                RowBox[{
                 SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
                RowBox[{"2", " ", 
                 RowBox[{
                  SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}]}], ")"}], 
              "-", 
              RowBox[{"2", " ", 
               RowBox[{"sin", "(", 
                RowBox[{
                 SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], ")"}]}]}], 
             ")"}]}]}], ")"}]}], 
        RowBox[{
         RowBox[{"4", " ", 
          RowBox[{
           SuperscriptBox["cos", "2"], "(", 
           RowBox[{
            SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "-", 
         "5"}]]}]},
     {
      FractionBox[
       RowBox[{"4", " ", 
        RowBox[{"cos", "(", 
         FractionBox[
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], "2"], ")"}], " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"2", " ", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", " ", 
              RowBox[{"sin", "(", 
               FractionBox[
                RowBox[{
                 SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], "2"], 
               ")"}]}], "+", 
             RowBox[{"sin", "(", 
              FractionBox[
               RowBox[{"3", " ", 
                RowBox[{
                 SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], "2"], 
              ")"}]}], ")"}], " ", 
           SuperscriptBox[
            RowBox[{
             SuperscriptBox[
              SubscriptBox["\[Theta]", "1"], "\[Prime]",
              MultilineFunction->None], "(", "t", ")"}], "2"]}], "+", 
          RowBox[{"2", " ", 
           RowBox[{"sin", "(", 
            FractionBox[
             RowBox[{"3", " ", 
              RowBox[{
               SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], "2"], ")"}], 
           " ", 
           RowBox[{
            SuperscriptBox[
             SubscriptBox["\[Theta]", "2"], "\[Prime]",
             MultilineFunction->None], "(", "t", ")"}], " ", 
           RowBox[{
            SuperscriptBox[
             SubscriptBox["\[Theta]", "1"], "\[Prime]",
             MultilineFunction->None], "(", "t", ")"}]}], "+", 
          RowBox[{
           RowBox[{"sin", "(", 
            FractionBox[
             RowBox[{"3", " ", 
              RowBox[{
               SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], "2"], ")"}], 
           " ", 
           SuperscriptBox[
            RowBox[{
             SuperscriptBox[
              SubscriptBox["\[Theta]", "2"], "\[Prime]",
              MultilineFunction->None], "(", "t", ")"}], "2"]}], "-", 
          RowBox[{"30", " ", 
           RowBox[{"sin", "(", 
            RowBox[{
             RowBox[{
              SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "-", 
             FractionBox[
              RowBox[{
               SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], "2"]}], 
            ")"}]}], "+", 
          RowBox[{"20", " ", 
           RowBox[{"cos", "(", 
            FractionBox[
             RowBox[{
              SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], "2"], ")"}], 
           " ", 
           RowBox[{"sin", "(", 
            RowBox[{
             RowBox[{
              SubscriptBox["\[Theta]", "1"], "(", "t", ")"}], "+", 
             RowBox[{
              SubscriptBox["\[Theta]", "2"], "(", "t", ")"}]}], ")"}]}]}], 
         ")"}]}], 
       RowBox[{
        RowBox[{"4", " ", 
         RowBox[{
          SuperscriptBox["cos", "2"], "(", 
          RowBox[{
           SubscriptBox["\[Theta]", "2"], "(", "t", ")"}], ")"}]}], "-", 
        "5"}]]}
    },
    GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
      "RowsIndexed" -> {}},
    GridBoxSpacings->{"Columns" -> {
        Offset[0.27999999999999997`], {
         Offset[0.7]}, 
        Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
        Offset[0.2], {
         Offset[0.4]}, 
        Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{{3.543926251989669*^9, 3.5439262770851045`*^9}}]
}, Open  ]],

Cell["\<\
Linearize to find the A and B matrices:\
\>", "Text",
 CellChangeTimes->{{3.5439263267989483`*^9, 3.543926334495388*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"A", "=", 
  RowBox[{"Join", "[", 
   RowBox[{
    RowBox[{"Join", "[", 
     RowBox[{
      RowBox[{"ConstantArray", "[", 
       RowBox[{"0", ",", 
        RowBox[{"{", 
         RowBox[{"ndof", ",", "ndof"}], "}"}]}], "]"}], ",", 
      RowBox[{"IdentityMatrix", "[", "ndof", "]"}], ",", "2"}], "]"}], ",", 
    RowBox[{
     SubscriptBox["\[PartialD]", 
      RowBox[{"{", 
       RowBox[{"Join", "[", 
        RowBox[{"q", ",", "dq"}], "]"}], "}"}]], 
     RowBox[{"Linearize", "[", 
      RowBox[{
       RowBox[{"ddq", "/.", "\[InvisibleSpace]", "sol"}], ",", 
       RowBox[{"Join", "[", 
        RowBox[{"q", ",", "dq"}], "]"}], ",", 
       RowBox[{"ConstantArray", "[", 
        RowBox[{"0", ",", 
         RowBox[{"2", "ndof"}]}], "]"}]}], "]"}]}], ",", "1"}], 
   "]"}]}]], "Input",
 CellChangeTimes->{{3.543922500150076*^9, 3.543922559464469*^9}, {
  3.5439226228890963`*^9, 3.5439228100438013`*^9}, {3.5439232517640657`*^9, 
  3.543923263114715*^9}, {3.543923335843875*^9, 3.543923336139892*^9}, {
  3.5439244936470976`*^9, 3.5439245624810348`*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{"(", "\[NoBreak]", GridBox[{
     {"0", "0", "1", "0"},
     {"0", "0", "0", "1"},
     {
      RowBox[{"-", "20"}], "40", "0", "0"},
     {"40", 
      RowBox[{"-", "140"}], "0", "0"}
    },
    GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
      "RowsIndexed" -> {}},
    GridBoxSpacings->{"Columns" -> {
        Offset[0.27999999999999997`], {
         Offset[0.7]}, 
        Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
        Offset[0.2], {
         Offset[0.4]}, 
        Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{{3.5439225063724318`*^9, 3.5439225220643296`*^9}, {
   3.543922628831436*^9, 3.543922643812293*^9}, {3.543922677061195*^9, 
   3.5439227436220016`*^9}, 3.543922810517828*^9, {3.5439232525451107`*^9, 
   3.543923268728036*^9}, {3.543923336326903*^9, 3.543923369286788*^9}, 
   3.5439234363126216`*^9, {3.5439244689256835`*^9, 3.543924494260133*^9}, {
   3.543924551264393*^9, 3.5439245628140535`*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"B", "=", 
  RowBox[{"Join", "[", 
   RowBox[{
    RowBox[{"ConstantArray", "[", 
     RowBox[{"0", ",", 
      RowBox[{"{", 
       RowBox[{"ndof", ",", "ndof"}], "}"}]}], "]"}], ",", 
    RowBox[{"Inverse", "[", 
     RowBox[{
      RowBox[{
       SubscriptBox["\[PartialD]", 
        RowBox[{"{", 
         RowBox[{"dq", ",", "2"}], "}"}]], "T"}], "/.", 
      RowBox[{
       RowBox[{
        SubscriptBox["\[Theta]", "2"], "[", "t", "]"}], "\[Rule]", "0"}]}], 
     "]"}], ",", "1"}], "]"}]}]], "Input",
 CellChangeTimes->{{3.5439231413617516`*^9, 3.5439231684302998`*^9}, {
  3.543924631504983*^9, 3.543924653505241*^9}, {3.5439262134094625`*^9, 
  3.54392623085046*^9}}],

Cell[BoxData[
 FormBox[
  RowBox[{"(", "\[NoBreak]", GridBox[{
     {"0", "0"},
     {"0", "0"},
     {"4", 
      RowBox[{"-", "12"}]},
     {
      RowBox[{"-", "12"}], "40"}
    },
    GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
      "RowsIndexed" -> {}},
    GridBoxSpacings->{"Columns" -> {
        Offset[0.27999999999999997`], {
         Offset[0.7]}, 
        Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
        Offset[0.2], {
         Offset[0.4]}, 
        Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], 
  TraditionalForm]], "Output",
 CellChangeTimes->{
  3.543923149824235*^9, 3.5439232687560377`*^9, 3.5439233693117895`*^9, 
   3.5439234363376226`*^9, 3.543924578919975*^9, {3.543924634920178*^9, 
   3.54392465384026*^9}, {3.5439262177457104`*^9, 3.543926231234482*^9}}]
}, Open  ]]
},
WindowSize->{944, 944},
WindowMargins->{{Automatic, 0}, {Automatic, 0}},
ShowSelection->True,
FrontEndVersion->"8.0 for Microsoft Windows (64-bit) (November 7, 2010)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[545, 20, 343, 7, 65, "Text"],
Cell[CellGroupData[{
Cell[913, 31, 133, 2, 31, "Input"],
Cell[1049, 35, 260, 4, 30, "Output"]
}, Open  ]],
Cell[1324, 42, 181, 3, 52, "Input"],
Cell[1508, 47, 1483, 37, 72, "Input"],
Cell[2994, 86, 131, 3, 29, "Text"],
Cell[3128, 91, 249, 5, 31, "Input"],
Cell[3380, 98, 628, 20, 72, "Input"],
Cell[4011, 120, 808, 25, 52, "Input"],
Cell[4822, 147, 957, 30, 55, "Input"],
Cell[5782, 179, 136, 3, 29, "Text"],
Cell[CellGroupData[{
Cell[5943, 186, 1158, 36, 55, "Input"],
Cell[7104, 224, 1640, 46, 102, "Output"],
Cell[8747, 272, 2529, 72, 102, "Output"]
}, Open  ]],
Cell[11291, 347, 131, 3, 29, "Text"],
Cell[CellGroupData[{
Cell[11447, 354, 640, 19, 31, "Input"],
Cell[12090, 375, 3288, 91, 68, "Output"]
}, Open  ]],
Cell[15393, 469, 101, 1, 29, "Text"],
Cell[CellGroupData[{
Cell[15519, 474, 323, 9, 55, "Input"],
Cell[15845, 485, 1458, 42, 48, "Output"]
}, Open  ]],
Cell[17318, 530, 99, 1, 29, "Text"],
Cell[CellGroupData[{
Cell[17442, 535, 554, 15, 55, "Input"],
Cell[17999, 552, 717, 20, 30, "Output"]
}, Open  ]],
Cell[18731, 575, 97, 1, 29, "Text"],
Cell[CellGroupData[{
Cell[18853, 580, 158, 3, 31, "Input"],
Cell[19014, 585, 1933, 57, 48, "Output"]
}, Open  ]],
Cell[20962, 645, 126, 3, 29, "Text"],
Cell[CellGroupData[{
Cell[21113, 652, 885, 22, 31, "Input"],
Cell[22001, 676, 6041, 168, 135, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[28079, 849, 429, 9, 31, "Input"],
Cell[28511, 860, 5972, 166, 94, "Output"]
}, Open  ]],
Cell[34498, 1029, 131, 3, 29, "Text"],
Cell[CellGroupData[{
Cell[34654, 1036, 1087, 28, 52, "Input"],
Cell[35744, 1066, 1097, 26, 80, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[36878, 1097, 701, 20, 31, "Input"],
Cell[37582, 1119, 875, 24, 80, "Output"]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
